<extend name="Base/common"/>
<block name="header">
    <include file="Public/_nav"/>
</block>

<block name="body">
    <style>
        #main-container {
            width: 1000px;
        }
    </style>
    <script type="text/javascript" src="__PUBLIC__/js/ajaxfileupload.js"></script>
    <link href="__CSS__/weibo.css" type="text/css" rel="stylesheet"/>
    <!--微博内容列表部分-->
    <div class="weibo_middle pull-left">
        <include file="_quickweibo"/>
        <!--  筛选部分-->
        <div class="weibo-filter-wrap">
            <php>if(!is_login()) $style='margin-top:0'</php>
            <div id="weibo_filter">
                <div class="weibo_icon">
                    <php>
                        $show_icon_eye_open=0;
                        if(count($top_list)){
                        $hide_ids=cookie('Weibo_index_top_hide_ids');
                        if(mb_strlen($hide_ids,'utf-8')){
                        $hide_ids=explode(',',$hide_ids);
                        foreach($top_list as $val){
                        if(in_array($val,$hide_ids)){
                        $show_icon_eye_open=1;
                        break;
                        }
                        }}}
                        if(count($top_list)){
                        if($show_icon_eye_open){
                    </php>
                    <li data-weibo-id="{$weibo.id}" title="{:L('_SHOW_ALL_TOP_')}{$MODULE_ALIAS}"
                        data-role="show_all_top_weibo">
                        <i class="icon icon-eye-open"></i>
                    </li>
                    <php>}else{</php>
                    <li data-weibo-id="{$weibo.id}" title="{:L('_SHOW_ALL_TOP_')}{$MODULE_ALIAS}"
                        data-role="show_all_top_weibo" style="display: none;">
                        <i class="icon icon-eye-open"></i>
                    </li>
                    <php>}}</php>
                </div>
                <volist name="tab_config" id="tab">
                    <li class="a-wrap">
                        <a id="{$tab}"
                        <if condition="in_array($tab,$need_login_tab)">href="javascript:toast.error('请先登录！');"
                            <else/>
                            href="{:U('Weibo/Index/index',array('type'=>$tab))}"
                        </if>
                        >
                        <switch name="tab">
                            <case value="concerned">
                                <p><i class="icon icon-flow"></i></p>
                                <p class="mg-bt0">{:L('_MY_FOLLOWING_')}</p>
                            </case>
                            <case value="hot">
                                <p><i class="icon icon-hot"></i></p>
                                <p class="mg-bt0">{:L('_HOT_WEIBO_')}</p>
                            </case>
                            <case value="all">
                                <p><i class="icon icon-all"></i></p>
                                <p class="mg-bt0">{:L('_ALL_WEBSITE_WEIBO_')}</p>
                            </case>
                            <case value="fav">
                                <p><i class="icon icon-my"></i></p>
                                <p class="mg-bt0">{:L('_MY_FAV_')}</p>
                            </case>
                        </switch>
                        </a>
                    </li>
                </volist>
            </div>
            <script>
                $('#weibo_filter #{$filter_tab}').addClass('active');
            </script>
            <div class="add-weibo" data-role="switch_sendBox">
                <i class="os-icon-speech"></i>
                <p>发动态</p>
            </div>
        </div>

        <!--筛选部分结束-->
        <div id="top_list">
            <volist name="top_list" id="top">
                {:W('WeiboDetail/detail',array('weibo_id'=>$top,'can_hide'=>1))}
            </volist>
        </div>
        <div id="weibo_list">
            <php>
                if($page != 1){
            </php>
            <include file="loadweibo"/>
            <php>
                }
            </php>

        </div>
        <div id="load_more" class="text-center text-muted"
        <if condition="$page neq 1">style="display:none"</if>
        >
        <div id="load_more_text">
            <div class="sk-cube-grid">
                <div class="sk-cube sk-cube1"></div>
                <div class="sk-cube sk-cube2"></div>
                <div class="sk-cube sk-cube3"></div>
                <div class="sk-cube sk-cube4"></div>
                <div class="sk-cube sk-cube5"></div>
                <div class="sk-cube sk-cube6"></div>
                <div class="sk-cube sk-cube7"></div>
                <div class="sk-cube sk-cube8"></div>
                <div class="sk-cube sk-cube9"></div>
            </div>
        </div>
    </div>

    <!--分页-->
    <div id="index_weibo_page" style=" <if condition='$page eq 1'>display:none</if>">
        <div class="text-right">
            {:getPagination($total_count,30)}
        </div>
    </div>
    </div>

    <!--微博内容列表部分结束-->
    <!--首页右侧部分-->
    <div class="weibo_right">
        <!--我的社群stat-->
        <if condition="is_login()">
            <div class="my-community">
                <div class="ck-sign">
                    <php>if(!$check){</php>
                    <img src="__IMG__/checking.png" alt="">
                    <php>}else{</php>
                    <img src="__IMG__/checked.png" alt="">
                    <php>}</php>
                </div>
                <p class="notice-head">我的社群</p>
                <div class="mc-grade row">
                    <div class="col-xs-3 mc-box left-box">
                        <div class="mc-icon-wrap">
                            <i class="i-heart"></i>
                        </div>
                    </div>
                    <div class="col-xs-4 mc-box center-box">
                        <span>{$today_score}</span>
                        <p>今日经验</p>
                    </div>
                    <div class="col-xs-5 mc-box text-ellipsis">
                        <span style="color: #666">{$title.left|intval}</span>
                        <p style="margin: 0 25px">剩余经验</p>
                    </div>
                </div>
                <div class="grade-box">
                    <php>
                        $title=D('Ucenter/Title')->getCurrentTitleInfo(is_login());
                    </php>
                    <script>
                        $(function () {
                            $('#upgrade').tooltip({
                                        html: true,
                                        title: '{:L("_CURRENT_LEVEL_")}：{$self.title} <br/>{:L("_NEXT_LEVEL_")}：{$title.next}<br/>{:L("_NOW_")}：{$self.score}<br/>{:L("_NEED_")}：{$title.upgrade_require}<br/>{:L("_LAST_")}： {$title.left}<br/>{:L("_PROGRESS_")}：{$title.percent}% <br/> '
                                    }
                            );
                        })
                    </script>
                    <div class="row">
                        <div class="col-xs-3 l-box"><span>当前等级</span></div>
                        <div class="col-xs-9 r-box">
                            <div id="upgrade" class="upgrade" data-toggle="tooltip" data-placement="bottom" title="">
                                <div class="grade-bottom"></div>
                                <div class="grade-top" style="width:{$title.percent}%;"></div>
                            </div>
                        </div>
                    </div>

                    <div class="row gg-wrap">
                        <p class="pull-left">{$self.title}</p>
                        <p class="pull-right" style="color: #999">{$title.next}</p>
                    </div>
                </div>
                <div class="gg-check row">
                    <div class="col-xs-3 c-box" data-role="open_checkBox" style="cursor: pointer">
                        <php>if(!$check){</php>
                        <i class="c-icon c-icon-checking"></i>
                        <p style="color:red;">签到</p>
                        <php>}else{</php>
                        <i class="c-icon c-icon-checked"></i>
                        <p>签到</p>
                        <php>}</php>
                    </div>
                    <a href="{:U('Ucenter/index/ranking')}">
                        <div class="col-xs-3 c-box">
                            <i class="c-icon c-icon-rank"></i>
                            <p class="pc6">排行</p>
                        </div>
                    </a>
                    <if condition="$ping || $Charge">
                        <a href="{$ping?U('Pingxx/index/index'):U('Recharge/index/index')}">
                            <div class="col-xs-3 c-box">
                                <i class="c-icon c-icon-ping"></i>
                                <p class="pc6">充值</p>
                            </div>
                        </a>
                    </if>

                    <if condition="$shop">
                        <a href="{:U('Shop/index/index')}">
                            <div class="col-xs-3 c-box">
                                <i class="c-icon c-icon-change"></i>
                                <p class="pc6">兑换</p>
                            </div>
                        </a>
                    </if>
                </div>
            </div>
        </if>
        <!--我的社群end-->
        <!--签到日历stat-->
        <div class="hide-check-box" style="display: none">
            <h5>
                <a href="javascript:">我的签到日历</a>
                <a href="javascript:" class="pull-right" data-role="close_checkBox">X</a>
            </h5>
            {:W('Ucenter/signCalendar/render')}
            <div class="checkin">
                {:hook('checkIn')}
            </div>
        </div>
        <!--签到日历end-->
        <!--热门话题排行start-->
        <div class="wb-topic">
            <p class="topic-head">话题排行</p>
            <div class="topic-content">
                <ul>
                    <volist name="hot_topic_list" id="one_topic" key="one_topic_key">
                        <?php
                            if($one_topic_key<=3){
                            $one_topic_class='num-top';
                            }else{
                            $one_topic_class='';
                            }
                        ?>
                        <li><a href="{:U('Topic/index',array('topk'=>$one_topic['id']))}" title="{$one_topic['name']}">
                            <div class="num {$one_topic_class}">{$one_topic_key}</div>
                            <div>{$one_topic['name']}</div>
                            <div>{$one_topic['weibo_num']}</div>
                        </a></li>
                    </volist>
                </ul>
            </div>
        </div>
        <!--热门话题排行end-->
        <!--社群公告stat-->
        <div class="wb-notice">
            <p class="notice-head">社群公告</p>
            <div class="notice-content">
                {:W('Common/Adv/render',array(array('name'=>'filter_right','type'=>3,'title'=>'过滤右方')))}
            </div>
        </div>
        <!--社群公告end-->
        {:W('Common/Adv/render',array(array('name'=>'below_self_info','type'=>1,'width'=>'280px','height'=>'100px','margin'=>'0
        0 10px 0','title'=>'个人资料下方')))}
        <div style="position: relative">
            {:hook('weiboSide')}
            <!--广告位-->
            {:W('Common/Adv/render',array(array('name'=>'below_checkrank','type'=>1,'width'=>'280px','height'=>'100px','title'=>'签到下方广告')))}
            <!--广告位end-->
            {:hook('Advs',array('pos'=>'weibo_right_below_all','type'=>1,'width'=>'280px','height'=>'100px','title'=>'微博右侧底部广告'))}
        </div>
    </div>
    <!--首页右侧部分结束-->
</block>
<block name="script">
    <script src="__JS__/weibo.js"></script>
    <script>
        var SUPPORT_URL = "{:addons_url('Support://Support/doSupport')}";
        weibo.page = '{$page}';
        weibo.loadCount = 0;
        weibo.lastId = parseInt('{$list|reset}') + 1;
        weibo.url = "{$loadMoreUrl}";
        weibo.type = "{$type}";
        $(function () {
            weibo_bind();
            //当屏幕滚动到底部时
            if (weibo.page == 1) {
                $(window).on('scroll', function () {
                    if (weibo.noMoreNextPage) {
                        return;
                    }
                    if (weibo.isLoadingWeibo) {
                        return;
                    }
                    if (weibo.isLoadMoreVisible()) {
                        weibo.loadNextPage();
                    }
                });
                $(window).trigger('scroll');
            }
        });
        $(document).ready(function () {
            $('[data-role="switch_sendBox"]').click(function () {
                if (is_login()) {
                    $("#send_box").slideToggle("slow");
                    $("#weibo_content").focus();
                } else {
                    toast.error('请先登录！');
                }
            });
            $('[data-role="open_checkBox"]').click(function () {
                $(".hide-check-box").fadeToggle("slow");
            });
            $('[data-role="close_checkBox"]').click(function () {
                $(".hide-check-box").fadeToggle("slow");
            });
        });
    </script>
    <link rel="stylesheet" href="__CSS__/photoswipe.css">
    <link rel="stylesheet" href="__CSS__/default-skin/default-skin.css">
    <script src="__JS__/photoswipe.min.js"></script>
    <script src="__JS__/photoswipe-ui-default.min.js"></script>
</block>
